package com.edgclub.edg.uc;

import android.app.Dialog;
import android.content.Context;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;

import com.edgclub.edg.R;
import com.edgclub.edg.model.HonourBean;

/**
 * 确定取消的对话框
 * 
 * @author 陈坤彬
 *
 */
public class HonourDialog extends Dialog {

	private Context context;

	private TextView mHonour_title;
	private TextView mHonour_content;

	// End Of Content View Elements
	private Dialog dialog;

	private HonourDialog instance;

	public static HonourDialog create(Context context) {
		HonourDialog instance = new HonourDialog(context);
		return instance;

	}

	private HonourDialog(Context context) {
		super(context, R.style.MyAlertDialog);
		init(context);
	}

	private void init(Context context) {
		this.context = context;
		WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
		lp.width = context.getResources().getDisplayMetrics().widthPixels;

		View contentView = LayoutInflater.from(context).inflate(
				R.layout.layout_honour_dialog, null);

		setContentView(contentView, lp);
		mHonour_title = (TextView) findViewById(R.id.honour_title);
		mHonour_content = (TextView) findViewById(R.id.honour_content);


	}
	public void setLeave(HonourBean honourBean){
		mHonour_title.setText(honourBean.getName()+"勋章");
		mHonour_content.setText(Html.fromHtml("获取资格：等级达到<font color=\"#ff0000\">"+honourBean.getLevel()+"</font>级"));
	}


}
